package cn.ddiancan.xddcloud.psc.base.feign;

import java.util.List;

import cn.ddiancan.xddcloud.common.entity.CommonResult;
import cn.ddiancan.xddcloud.common.entity.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "UserRemoteClientService", value = UserRemoteClientService.targetService)
public interface UserRemoteClientService {

    String targetService = "xddcloud-psc";

    @PostMapping("/psc/user/batch/user")
    CommonResult<List<UserVO>> getUserByIds(@RequestBody List<String> ids);

    @GetMapping("/psc/user/id/{userId}")
    CommonResult<UserVO> loadUserById(@PathVariable("userId") String id);

    @GetMapping("/psc/user/account/{userAccount}")
    CommonResult<UserVO> loadUserByAccount(@PathVariable("userAccount") String userAccount);

    @GetMapping("/psc/permission/user/{userAccount}")
    CommonResult<UserVO> loadUserPermissionByAccount(@PathVariable("userAccount") String userAccount);

    @GetMapping("/psc/permission/user/authCode/{tempAuthCode}")
    CommonResult<UserVO> loadUserPermissionByTempAuthCode(@PathVariable("tempAuthCode") String tempAuthCode);

    @GetMapping("/psc/user/getUserByDeptId/{deptId}")
    CommonResult<List<UserVO>> getUserByDeptId(@PathVariable("deptId") String deptId);

    @GetMapping("/psc/openai/chat")
    CommonResult<String> doChat(@RequestParam(value = "words",required = false) String words);
}
